package org.traffometer.packet.location;

/**
 * Implements a representation of a location on earth. More specially, the location of a vehicle 
 * on a road, although there is no specific information that distinguishes a road from any
 * other location. 
 * <p> 
 *
 * @author Aaron A. Kagawa
 * @version $Id$
 */
public class Location {

  private Latitude latitude = null;
  private Longitude longitude = null;
  
  /**
   * Constructs a Location object. 
   * @param longitude The longitude coordinate associated with this location.
   * @param latitude The latitude coordinate associated with this location.
   */
  public Location(Longitude longitude, Latitude latitude) {
    this.longitude = longitude;
    this.latitude = latitude;
  }
  
  /**
   * Returns the longitude coordinate of this location.
   * @return The longitude coordinate.
   */
  public Longitude getLongitude() {
    return this.longitude;
  }
  
  /**
   * Returns the latitude coordinate of this location.
   * @return The latitude coordinate.
   */
  public Latitude getLatitude() {
    return this.latitude;
  }
  
  /**
   * {@inheritDoc}.
   * The toString will have the following format: <br>
   * &lt;longitude.toString()&gt;, &lt;latitude.toString()&gt;,  
   */
  public String toString() {
    return this.longitude.toString() + ", " + this.latitude.toString();
  }
  
}
